﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Copy of VehicleEdit.aspx.cs" Inherits="VehicleEdit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Job Order</title>
    <link href="/Style/StyleSheet.css" rel="stylesheet" type="text/css" />
    <style>
.dxbButton {   	font-size: 11px; }
</style>
</head>
<body>
    <form id="form1" runat="server">

    <script type="text/javascript">
        function ShowEdit() {
            window.open("../Edit/Job.aspx?OrderNo=" + txt_Sn.GetText(), "name1", "width=1020,height=600,toolbar=no,scrollbars=no,menubar=no");
        }
        var clientId = null;
        var clientName = null;
        var clientAdr = null;
        var clientContact = null;
        function PutValue(s, name) {
            if (clientId != null) {
                clientId.SetText(s);
                if (clientName != null) {
                    clientName.SetText(name);
                }
                popubCtr.Hide();
                popubCtr.SetContentUrl('about:blank');
            }
        }
        function PutValue(s, name,address,contact) {
            if (clientId != null) {
                clientId.SetText(s);
                if (clientName != null) {
                    clientName.SetText(name);
                }
                if (clientAdr != null)
                    clientAdr.SetText(address);
                if (clientContact != null)
                    clientContact.SetText(contact);
                popubCtr.Hide();
                popubCtr.SetContentUrl('about:blank');
            }
        }
        function PopupCust(txtId, txtName,txtAdr,txtContact) {
            clientId = txtId;
            clientName = txtName;
            clientAdr = txtAdr;
            clientContact = txtContact;
            popubCtr.SetContentUrl('/Modules/SelectPage/CustomerPick.aspx');
            popubCtr.SetHeaderText('Customer');
            popubCtr.Show();
        }


        function PopupUploadPhoto() {
            popubCtr.SetHeaderText('Upload Documents');
            popubCtr.SetContentUrl('../Upload.aspx?Sn=' + txt_Sn.GetText());
            popubCtr.Show();
        }
        function PopupUploadPhotoServer() {
            popubCtr1.SetHeaderText('Upload Documents');
            popubCtr1.SetContentUrl('/Pages/UploadFromServer.aspx?sn=' + txt_OrderNo.GetText());
            popubCtr1.Show();
        }
        function AfterUploadPhoto() {
            popubCtr.Hide();
            popubCtr.SetContentUrl('about:blank');
        }

        ////////////////for dropdown list
        function RowClickHandler(s, e) {
            SetLookupKeyValue(e.visibleIndex);
            DropDownEdit.HideDropDown();
        }
        function SetLookupKeyValue(rowIndex) {
            DropDownEdit.SetText(GridView.cpKeyValues[rowIndex]);
            txt_Job_SealNo.SetText(GridView.cpSealN[rowIndex]);
        }

        /////////////////////////////////////////////////////////////////////////////////////////////////
        var grid = null;
        function AddBill(gridId) {
            grid = gridId;
            popubCtr1.SetHeaderText('Invoice');
            popubCtr1.SetContentUrl('/Modules/Account/EditPage/InvoiceEdit.aspx?InvN=0&sn=' + txt_OrderNo.GetText());
            popubCtr1.Show();
        }
        function ShowBill(gridId, no) {
            grid = gridId;
            popubCtr1.SetHeaderText('Invoice');
            popubCtr1.SetContentUrl('/Modules/Account/EditPage/InvoiceEdit.aspx?InvN=' + no + '&sn=' + txt_OrderNo.GetText());
            popubCtr1.Show();
        }
        function PrintEstimate() {
            window.open("/Reports/printview.aspx?doc=51&no=" + txt_OrderNo.GetText());
        }
        
       
        function RowClickHandler(s, e) {
            SetLookupKeyValue(e.visibleIndex);
            de_ChgCode.HideDropDown();
        }
        function SetLookupKeyValue(rowIndex) {
            de_ChgCode.SetValue(GridView_ChgCode.cpKeyValues[rowIndex]);
            spin_det_TotAmt.SetNumber(GridView_ChgCode.cpAmt[rowIndex]);
        }

        function OnMakeChanged(cmbMake) {
            grid.GetEditor("Model").PerformCallback(cmbMake.GetValue().toString());
        }
    </script>

<asp:SqlDataSource ID="dsPickColorFormular"	SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1001 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickColorMatch" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1002 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickMarketingSource" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1003 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickOrderStatus" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1004 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickColorOption" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1005 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickDepartment" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1006 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickWorkType" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1007 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickWorkLocation" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1008 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickServiceType" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1009 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickRepairStatus" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1010 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickCustomerGroup" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1011 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickPrimaryColor" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1012 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickBranchGroup" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1013 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickEmployeeGroup" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1014 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickPhoneType" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1015 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickBranchStatus" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1016 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickEmploymentStatus" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1017 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickPaymentTerm" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1018 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickVehicleYear" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1019 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickPaymentMethod" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1019 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />


<asp:SqlDataSource ID="dsPickCountry" SelectCommand="select * from ddCountry order by countryname" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickState" SelectCommand="select * from ddState where countrycode='CA' order by statename" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickCity" SelectCommand="select * from ddCity where statecode='BC' order by statename" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickZoneCode" SelectCommand="select distinct zonecode from ddPostal order by zonename" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickVehicleMake" SelectCommand="select * from ddVehicleMake order by Name" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
<asp:SqlDataSource ID="dsPickVehicleModel" SelectCommand="select * from ddVehicleModel  order by ModelName" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />



         <wilson:DataSource ID="dsChgCode" runat="server" ObjectSpace="Touchmax.Manager.ORManager"
                TypeName="Touchmax.ChgCodeMast" KeyMember="SequenceId" FilterExpression="1=1" />
         <wilson:DataSource ID="dsVehicle" runat="server" ObjectSpace="Touchmax.Manager.ORManager"
            TypeName="Touchmax.OpVehicle" KeyMember="SequenceId" FilterExpression="1=0" />
             <wilson:DataSource ID="dsInvoiceDet" runat="server" ObjectSpace="Touchmax.Manager.ORManager"
                TypeName="Touchmax.InvoiceDet" KeyMember="SequenceId" FilterExpression="1=0" />
                
    <div>
  
            <dxwgv:ASPxGridView ID="grd_Cont" ClientInstanceName="grd_Cont" runat="server"
                DataSourceID="dsVehicle" KeyFieldName="SequenceId" Width="100%"
                  OnCustomCallback="grd_Cont_CustomCallback"
                            oninit="grd_Cont_Init"
                            OnInitNewRow="grd_Cont_InitNewRow" OnCellEditorInitialize="grid_CellEditorInitialize">
                            <SettingsBehavior ConfirmDelete="True" />
                            <SettingsPager Mode="ShowAllRecords">
                            </SettingsPager>
                            <SettingsEditing Mode="EditForm" />
                            <Settings ShowColumnHeaders="false" />
                <Templates>
                <EditForm>
                 <table>
                    <tr>
                    <td>
                                    <div style="display:none">
                    <dxe:ASPxTextBox ID="txt_Oid" Width="140" runat="server" Text='<%# Eval("SequenceId") %>'>
                    </dxe:ASPxTextBox>
                                    </div>
                    Year
                    </td>
                    <td>
                    <dxe:ASPxComboBox ID="cmb_Year" DataSourceID="dsPickVehicleYear" TextField="Code" ValueField="Code" Text='<%# Eval("Year") %>' Width="140" runat="server" EnableIncrementalFiltering="true"  DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith">
                    </dxe:ASPxComboBox>
                    </td>
                    <td>
                    Primary Color
                    </td>
                    <td>
                    <dxe:ASPxComboBox ID="cmb_Color1" DataSourceID="dsPickColorOption" TextField="Code" ValueField="Code" Text='<%# Eval("Color1") %>' Width="140" runat="server" EnableIncrementalFiltering="true"  DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith">
                    </dxe:ASPxComboBox>
                    </td>
                    <td>
                    Secondary Color
                    </td>
                    <td>
                    <dxe:ASPxComboBox ID="cmb_Color2" DataSourceID="dsPickColorOption" TextField="Code" ValueField="Code" Text='<%# Eval("Color2") %>' Width="140" runat="server" EnableIncrementalFiltering="true"  DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith">
                    </dxe:ASPxComboBox>
                    </td>
                    </tr>
                    <tr>
                    <td>
                    Make
                    </td>
                    <td>
                    <dxe:ASPxComboBox ID="cmb_Make" Text='<%# Eval("VehicleType") %>' DataSourceID="dsPickVehicleMake" TextField="Name" ValueField="Name" Width="140" runat="server" EnableIncrementalFiltering="true"  DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith">
                     <ClientSideEvents SelectedIndexChanged="function(s, e) { OnMakeChanged(s); }"></ClientSideEvents>
                    </dxe:ASPxComboBox>
                    </td>

                    <td>
                    Color Code
                    </td>
                    <td>
                    <dxe:ASPxTextBox ID="txt_ColorCode1" Width="140" runat="server" Text='<%# Eval("ColorCode1") %>'>
                    </dxe:ASPxTextBox>
                    </td>
                    <td>
                    Color Code
                    </td>
                    <td>
                    <dxe:ASPxTextBox ID="txt_ColorCode2" Width="140" runat="server"  Text='<%# Eval("ColorCode2") %>'>
                    </dxe:ASPxTextBox>
                    </td>
                    </tr>
                    <tr>
                        
                    <td>
                    Model
                    </td>
                    <td>
                    <dxe:ASPxComboBox ID="cmb_Model" DataSourceID="dsPickVehicleModel" TextField="ModelName" ValueField="ModelName" Text='<%# Eval("VehicleModel") %>' Width="140" runat="server" EnableIncrementalFiltering="true"  DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith">
                    </dxe:ASPxComboBox>
                    </td>
                        
                    <td>
                    Formula
                    </td>
                    <td>
                    <dxe:ASPxComboBox ID="cmb_Formula1" DataSourceID="dsPickColorFormular" TextField="Code" ValueField="Code"  Text='<%# Eval("Formula1") %>' Width="140" runat="server" EnableIncrementalFiltering="true"  DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith">
                   
                    </dxe:ASPxComboBox>
                    </td>
                    <td>
                    Formula
                    </td>
                    <td>
                    <dxe:ASPxComboBox ID="cmb_Formula2" DataSourceID="dsPickColorFormular" TextField="Code" ValueField="Code" Text='<%# Eval("Formula2") %>' Width="140" runat="server" EnableIncrementalFiltering="true"  DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith">
                    </dxe:ASPxComboBox>
                    </td>
                    </tr>

                    <tr>
                        
                    <td>
                    Stock#
                    </td>
                    <td>
                    <dxe:ASPxTextBox ID="txt_Stock" Width="140"
                    runat="server" Text='<%# Eval("VehicleNo") %>'>
                    </dxe:ASPxTextBox>
                    </td>
                        
                    <td>
                    Color Match
                    </td>
                    <td>
                    <dxe:ASPxComboBox ID="ASPxComboBox13" Width="140" runat="server" DataSourceID="dsPickColorMatch" TextField="Code" ValueField="Code"  EnableIncrementalFiltering="true"  DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith">
                    </dxe:ASPxComboBox>
                    </td>
                    <td>
                    Color Match
                    </td>
                    <td>
                    <dxe:ASPxComboBox ID="ASPxComboBox14" Width="140" runat="server" DataSourceID="dsPickColorMatch" TextField="Code" ValueField="Code"  EnableIncrementalFiltering="true"  DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith">
                    </dxe:ASPxComboBox>
                    </td>
                    </tr>


                    <tr>
                        
                    <td>
                    VIN #
                    </td>
                    <td>
                    <dxe:ASPxTextBox ID="txt_Vin" Width="140"
                    runat="server" Text='<%# Eval("Vin") %>'>
                    </dxe:ASPxTextBox>
                    </td>
                        
                    <td>
                    Job Status
                    </td>
                    <td>
                    <dxe:ASPxComboBox ID="cmb_JobStatus" Text='<%# Eval("Status") %>' DataSourceID="dsPickRepairStatus" TextField="Code" ValueField="Code"  Width="140" runat="server" EnableIncrementalFiltering="true"  DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith">
                    </dxe:ASPxComboBox>
                    </td>
                    <td>
                                     
                    </td>
                    <td>
                    </td>
                    </tr>

                    <tr>
                    <td>
                    Repair Note
                    </td>
                    <td colspan="5">
                    <dxe:ASPxMemo ID="ASPxMemo1" Width="640" Rows="3" runat="server" Text=''>
                    </dxe:ASPxMemo>
                    </td>
                    </tr>
                    <tr>
                    <td>Repair</td>
                    <td colspan="5">
    <dxwgv:ASPxGridView ID="grid_InvDet" ClientInstanceName="grid_det" runat="server"
        DataSourceID="dsInvoiceDet" KeyFieldName="SequenceId" OnBeforePerformDataSelect="grid_InvDet_BeforePerformDataSelect"
        OnRowUpdating="grid_InvDet_RowUpdating" OnRowInserting="grid_InvDet_RowInserting"
        OnInitNewRow="grid_InvDet_InitNewRow" OnInit="grid_InvDet_Init" OnRowDeleting="grid_InvDet_RowDeleting"
        AutoGenerateColumns="False" Width="640">
        <SettingsEditing Mode="EditForm" />
        <SettingsBehavior ConfirmDelete="True" />
        <Columns>
            <dxwgv:GridViewDataColumn Caption="#" Width="50" VisibleIndex="1">
                <DataItemTemplate>
                    <a href="#" onclick='if(confirm("Confirm Delete"))  {<%# "grid_det.DeleteRow("+Container.VisibleIndex+");"  %>}'>
                        Remove</a>
                </DataItemTemplate>
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataColumn Caption="#" Width="50">
                <DataItemTemplate>
                    <a href="#" onclick='<%# "grid_det.StartEditRow("+Container.VisibleIndex+"); " %>'>Edit</a>
                    
                </DataItemTemplate>
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataTextColumn Caption="Repair" FieldName="ChgCode" VisibleIndex="3"
                Width="130">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn Caption="Repair Description" FieldName="Remark" VisibleIndex="4"
                Width="270">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn Caption="Amount" FieldName="TotAmt" VisibleIndex="5"
                Width="80">
                <PropertiesTextEdit DisplayFormatString="0.00" />
            </dxwgv:GridViewDataTextColumn>
        </Columns>
        <Templates>
            <EditForm>
                <table style="border-bottom: solid 1px black;">
                    <tr>
                        <td width="40">
                            <dxe:ASPxTextBox Width="100%" ID="txt_det_LineN" runat="server" ReadOnly="true" Text='<%# Bind("DocLineNo") %>'>
                            </dxe:ASPxTextBox>
                        </td>
                        <td width="130">
<dxe:ASPxDropDownEdit ID="de_ChgCode" runat="server" ClientInstanceName="de_ChgCode" Width="130"
    AllowUserInput="False" Text='<%# Bind("ChgCode")%>'>
    <DropDownWindowTemplate>
        <dxwgv:ASPxGridView ID="gridPopCont" runat="server" AutoGenerateColumns="False" ClientInstanceName="GridView_ChgCode"
            Width="100px" DataSourceID="dsChgCode" KeyFieldName="Code" OnCustomJSProperties="gridPopCont_CustomJSProperties">
            <Columns>
                <dxwgv:GridViewDataTextColumn FieldName="ChgcodeId" VisibleIndex="0">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="FixedChgA" VisibleIndex="1">
                </dxwgv:GridViewDataTextColumn>
            </Columns>
            <ClientSideEvents RowClick="RowClickHandler" />
        </dxwgv:ASPxGridView>
    </DropDownWindowTemplate>
</dxe:ASPxDropDownEdit>
                        </td>
                        <td width="270">
                            <dxe:ASPxTextBox Width="100%" ID="txt_det_Des1" ClientInstanceName="txt_det_Des1"
                                runat="server" Text='<%# Bind("Remark") %>'>
                            </dxe:ASPxTextBox>
                        </td>
                        <td>
                            <dxe:ASPxSpinEdit Width="100%" ID="spin_det_TotAmt" ClientInstanceName="spin_det_TotAmt"
                                runat="server" Text='<%# Bind("TotAmt") %>' DisplayFormatString="0.00">
                                <SpinButtons ShowIncrementButtons="false" />
                            </dxe:ASPxSpinEdit>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="9" style="text-align: right; padding: 2px 2px 2px 2px">
                            <dxwgv:ASPxGridViewTemplateReplacement ID="UpdateButton1" ReplacementType="EditFormUpdateButton"
                                runat="server">
                            </dxwgv:ASPxGridViewTemplateReplacement>
                            <dxwgv:ASPxGridViewTemplateReplacement ID="CancelButton1" ReplacementType="EditFormCancelButton"
                                runat="server">
                            </dxwgv:ASPxGridViewTemplateReplacement>
                        </td>
                    </tr>
                </table>
            </EditForm>
        </Templates>
        <Settings ShowFooter="True" />
        <TotalSummary>
            <dxwgv:ASPxSummaryItem FieldName="TotAmt" DisplayFormat="0.00" ShowInGroupFooterColumn="TotAmt"
                SummaryType="Sum" />
        </TotalSummary>
    </dxwgv:ASPxGridView>
                        <tr><td></td><td>
                                    <dxe:ASPxButton ID="ASPxButton41" Width="140" runat="server" Text="Add Repair" Enabled='<%# SafeValue.SafeString(Eval("SequenceId"),"0")!="0"%>'  AutoPostBack="false" UseSubmitBehavior="false" >
                                    <ClientSideEvents Click="function(s,e) {
                                    grid_det.AddNewRow();
                                    }" />
                                    </dxe:ASPxButton></td>
                            </td>
                        <td  colspan="5" align="right">
                                    <dxe:ASPxButton ID="ASPxButton4" Width="140" runat="server" Text="Save"  AutoPostBack="false" UseSubmitBehavior="false" >
                                    <ClientSideEvents Click="function(s,e) {
                                    grd_Cont.PerformCallback('Save');
                                    }" />
                                    </dxe:ASPxButton></td></tr>
                    </table>


                
                </EditForm>
                </Templates>
            </dxwgv:ASPxGridView> 

                        <table style="text-align: right; padding: 2px 2px 2px 2px;width:600px;margin:10px;">
                        </table>
        <dxpc:ASPxPopupControl id="popubCtr" runat="server" CloseAction="CloseButton" Modal="True"
            PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" ClientInstanceName="popubCtr"
            HeaderText="Customer" AllowDragging="True" EnableAnimation="False" height="360"
            AllowResize="True" width="750" EnableViewState="False">
        </dxpc:ASPxPopupControl>
        <dxpc:ASPxPopupControl id="popubCtr1" runat="server" CloseAction="CloseButton" Modal="True"
            PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" ClientInstanceName="popubCtr1"
            HeaderText="Customer" AllowDragging="True" EnableAnimation="False" height="450"
            AllowResize="True" width="800" EnableViewState="False">
            <clientsideevents closeup="function(s, e) {
            
      if(grid!=null)
	    grid.Refresh();
	    grid=null;
}" />
        </dxpc:ASPxPopupControl>
    </div>
    </form>
</body>
<style>
.dxbButton {   	font-size: 11px; height:18px; }
.dxeEditArea { font-size:11px; height:17px;}
</style>
</html>
